﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditUser.aspx.cs" Inherits="EditUser"
    MasterPageFile="~/Master.master" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="Server">
    <h1 class="DemoTitle">
        人员基本信息管理
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
        <dx:ASPxGridView ID="gridView" runat="server" AutoGenerateColumns="False" Width="100%"
            DataSourceID="LSMDSourceMain" KeyFieldName="ID" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
            CssPostfix="Office2010Blue" OnRowInserting="gridView_RowInserting" 
            onrowcommand="gridView_RowCommand">
            <SettingsText EmptyDataRow="没有记录" />
            <Columns>
                <dx:GridViewDataTextColumn FieldName="UserName" VisibleIndex="1" Caption="用户名" CellStyle-HorizontalAlign="Center">
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Center">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Caption="所属城区" FieldName="Communities" VisibleIndex="2"
                    Name="t_Community_ID">
                    <%--<EditItemTemplate>
                        <dx:ASPxComboBox ID="cmbDis" runat="server" DataSourceID="SDSCom" TextField="Community_Name"
                            ValueField="Community_ID" ValueType="System.String">
                        </dx:ASPxComboBox>
                    </EditItemTemplate>--%>
                    <EditFormSettings CaptionLocation="Near" ></EditFormSettings>
                    <PropertiesComboBox Spacing="0" ValueType="System.String">
                    </PropertiesComboBox>
                    <EditFormSettings CaptionLocation="Near" />
                    <CellStyle HorizontalAlign="Center">
                    </CellStyle>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn FieldName="LoginName" VisibleIndex="3" Caption="登录名" CellStyle-HorizontalAlign="Center">
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Center">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="PassWord" VisibleIndex="4" Caption="密码" CellStyle-HorizontalAlign="Center">
                    <CellStyle HorizontalAlign="Center">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="联系电话" FieldName="Phone" ShowInCustomizationForm="True"
                    VisibleIndex="5">
                    <PropertiesTextEdit MaxLength="11">
                        <MaskSettings Mask="&lt;0..999999999999999999999999999999999999&gt;" />
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" />
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Center">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="操作" VisibleIndex="0">
                    <DataItemTemplate>
                        <a href='UserManage.aspx'>增加</a>
                        <a href='UserUpdate.aspx?id=<%#Eval("ID") %>'>修改</a>
                        <asp:LinkButton ID="lnkDelete" runat="server">删除</asp:LinkButton>
                    </DataItemTemplate>
                    <EditItemTemplate>
                      
                    </EditItemTemplate>
                </dx:GridViewDataTextColumn>
            </Columns>
            <SettingsBehavior AllowDragDrop="false" AllowGroup="true" />
            <SettingsBehavior AllowDragDrop="False"></SettingsBehavior>
            <SettingsPager AlwaysShowPager="True">
                <Summary Text="当前第{0}页，共{1}页，{2}条记录" />
                <Summary Text="当前第{0}页，共{1}页，{2}条记录"></Summary>
            </SettingsPager>
            <SettingsText EmptyDataRow="没有记录"></SettingsText>
            <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesPager>
                <PageNumber ForeColor="#3E4846">
                </PageNumber>
                <Summary ForeColor="#1E395B">
                </Summary>
            </StylesPager>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
        </dx:ASPxGridView>
        <dx:LinqServerModeDataSource ID="LSMDSourceMain" runat="server" ContextTypeName="DAL.DataClassesDataContext"
            EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Users"
            OnSelecting="LSMDSourceMain_Selecting" />
        <asp:SqlDataSource ID="SDSCom" runat="server" ConnectionString="<%$ ConnectionStrings:ManagerConnectionString %>"
            SelectCommand="SELECT [Community_ID], [Community_Name], [Parent_ID] FROM [Community] WHERE ([Parent_ID] = @Parent_ID)">
            <SelectParameters>
                <asp:Parameter DefaultValue="0" Name="Parent_ID" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
